import 'package:flutter/material.dart';
import 'package:flutterlearn/components/secondPager.dart';

class MyApp22 extends StatelessWidget {
  const MyApp22({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(
          '界面跳转',
          style: TextStyle(fontSize: 30, color: Colors.white),
        ),
        backgroundColor: Colors.red,
        centerTitle: true,
      ),
      body: GestureDetector(
        onTap: () {
          // 跳转到第二个界面
          // Navigator.push(
          //   context,
          //   MaterialPageRoute(builder: (context) => MyApp23()),
          // );
          Navigator.pushNamed(context, '/second');
        },
        child: Center(
          child: Text(
            '点击跳转到第二个界面',
            style: TextStyle(fontSize: 20, color: Colors.blue),
          ),
        ),
      ),
    );
  }
}
